//
//  MainViewController.m
//  FruitHelper
//
//  Created by 赵隆杰 on 2021/12/10.
//

#import "MainViewController.h"
#import "VHBaseNavigationController.h"
#import "Home_RootViewController.h"
#import "List_RootViewController.h"
#import "Finish_RootViewController.h"
#import "Set_RootViewController.h"


@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    if (@available(iOS 13.0, *)) {
        UITabBarAppearance * appearance = [[UITabBarAppearance alloc] init];
         // 背景色
        appearance.backgroundColor = [UIColor whiteColor];
        self.tabBar.standardAppearance = appearance;
        if (@available(iOS 15.0, *)) {
            self.tabBar.scrollEdgeAppearance = appearance;
        }
    }
    
    // 首页
    Home_RootViewController *home_rootVC = [Home_RootViewController new];
    VHBaseNavigationController *home_nav = [[VHBaseNavigationController alloc] initWithRootViewController:home_rootVC];
    home_nav.tabBarItem.title = @"首页";
    home_nav.tabBarItem.image = [[UIImage imageNamed:@"tabbar_home_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    home_nav.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabbar_home_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    // 列表
    List_RootViewController *list_rootVC = [List_RootViewController new];
    VHBaseNavigationController *list_nav = [[VHBaseNavigationController alloc] initWithRootViewController:list_rootVC];
    list_nav.tabBarItem.title = @"清单";
    list_nav.tabBarItem.image = [[UIImage imageNamed:@"tabbar_list_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    list_nav.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabbar_list_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    // 完成
    Finish_RootViewController *finish_rootVC = [Finish_RootViewController new];
    VHBaseNavigationController *finish_nav = [[VHBaseNavigationController alloc] initWithRootViewController:finish_rootVC];
    finish_nav.tabBarItem.title = @"完成";
    finish_nav.tabBarItem.image = [[UIImage imageNamed:@"tabbar_finish_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    finish_nav.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabbar_finish_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    // 设置
    Set_RootViewController *me_rootVC = [Set_RootViewController new];
    VHBaseNavigationController *me_nav = [[VHBaseNavigationController alloc] initWithRootViewController:me_rootVC];
    me_nav.tabBarItem.title = @"设置";
    me_nav.tabBarItem.image = [[UIImage imageNamed:@"tabbar_set_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    me_nav.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabbar_set_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    self.viewControllers = @[home_nav, list_nav, finish_nav, me_nav];
    
    self.tabBar.barTintColor = [UIColor whiteColor];
    self.tabBar.tintColor = kThemeColor;
}

@end
